{% macro pagination_widget(pagination, endpoint, values={}) %} 
<div class="page clearfix">
    <nav>
        <ul class="pagination">
            {% if pagination.has_prev %}
            <li ><a href="{{ url_for(endpoint, page=pagination.prev_num, **values) }}" aria-label="Previous"><span aria-hidden="true">上一页</span></a></li>
            {%else%}
            <li class="previous disabled"><span aria-label="Previous"><span aria-hidden="true">上一页</span></span></li>
            {% endif %}
            {% for page in pagination.iter_pages() %}
            {% if page %}
                {% if page == pagination.page %}
                <li class="active"><a href="javascript:">{{ page }}</a></li>
                {% else %}
                <li><a href="{{ url_for(endpoint, page=page, **values) }}">{{ page }}</a></li>
                {% endif %}
            {% else %}
                <li class="disabled"><a href="javascript:">&hellip;</a></li>
            {% endif %}
            {% endfor %}
            {% if pagination.has_next %}
            <li><a href="{{ url_for(endpoint, page=pagination.next_num, **values) }}" aria-label="Next"><span aria-hidden="true">下一页</span></a></li>
            {%else%}
            <li class="next disabled"><span aria-label="Next"><span aria-hidden="true">下一页</span></span></li>
            {% endif %}
        </ul>
    </nav>
</div>
{% endmacro %}


